package org.bigk.invoices.actions.login;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.apache.struts2.interceptor.validation.SkipValidation;
import org.bigk.invoices.actions.InvoicesActionSupport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;


@Controller
@Namespace("/unsecured/LoginAction")
@Results({
	@Result(name = com.opensymphony.xwork2.Action.INPUT, location = "/pages/login/Login.jsp"),
	@Result(name = com.opensymphony.xwork2.Action.SUCCESS, type = "dispatcher", params = { "location", "/j_spring_security_check"})

})
public class Login extends InvoicesActionSupport {
	
	private static final long serialVersionUID = -1032058474470861737L;
	
	private static final Logger logger = LoggerFactory.getLogger(Login.class);

	private String j_username;
	private String j_password;
	
	@Action("input")
	@SkipValidation
	public String input() {
		logger.debug("input() - start - end - return value=[{}]", INPUT);
		return INPUT;
	}

	@Action("LoginAction")
	public String login() {
		logger.debug("login() - start - end - return value=[{}]", SUCCESS);
		return SUCCESS;
	}

    public String getJ_username() {
        return j_username;
    }

    public void setJ_username(String j_username) {
        this.j_username = j_username;
    }

    public String getJ_password() {
        return j_password;
    }

    public void setJ_password(String j_password) {
        this.j_password = j_password;
    }
}
